package com.iot.redissonlock.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 描述: 锁配置
 * @author: myx
 * @date: 2018/7/13
 * Copyright © 2018-hotpot. All rights reserved.
 */
@ConfigurationProperties(prefix = IotlockConfig.PREFIX)
@Data
public class IotlockConfig {

    public static final String PREFIX = "iot.lock";
    //redissonlock
    private String address;
    private String password;
    private int database=15;
    private ClusterServer clusterServer;
    private String codec = "org.redisson.codec.JsonJacksonCodec";
    //lock
    private long waitTime = 60;
    private long leaseTime = 60;

    public static class ClusterServer{

        private String[] nodeAddresses;

        public String[] getNodeAddresses() {
            return nodeAddresses;
        }

        public void setNodeAddresses(String[] nodeAddresses) {
            this.nodeAddresses = nodeAddresses;
        }
    }
}
